using System;
using System.Collections.Generic;
using System.Text;
using FireStarter.Base;
using FireStarter.CodeGeneration;
using FireStarterModeller.BO;
using NUnit.Framework;

namespace FireStarter.Test.CodeGeneration
{
    [TestFixture]
    public class TestBoTestProjectTemplateLoader: TestBase
    {
        [Test]
        public void Test_TestBase()
        {
            //---------------Set up test pack-------------------
            BoTestProjectTemplateLoader templateLoader = new BoTestProjectTemplateLoader(new List<IModelClass>());
            string boProjectName = GetRandomString();
            string boTestProjectName = GetRandomString();

            DMSolution dmSolution = new DMSolution();
            dmSolution.BOProjectName = boProjectName;
            dmSolution.BOTestProjectName = boTestProjectName;
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            string contents = templateLoader.GetTestBaseClass(dmSolution);
            //---------------Test Result -----------------------
            StringAssert.Contains(string.Format("namespace {0}", boTestProjectName), contents);
        }

        [Test]
        public void Test_TestUtils()
        {
            //---------------Set up test pack-------------------
            List<IModelClass> modelClasses = new List<IModelClass>();
            BoTestProjectTemplateLoader templateLoader = new BoTestProjectTemplateLoader(modelClasses);
            string boProjectName = GetRandomString();
            string boTestProjectName = GetRandomString();

            DMSolution dmSolution = new DMSolution();
            dmSolution.BOProjectName = boProjectName;
            dmSolution.BOTestProjectName = boTestProjectName;
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            string contents = templateLoader.GetTestUtilsClass(dmSolution);
            //---------------Test Result -----------------------
            StringAssert.Contains(string.Format("namespace {0}", boTestProjectName), contents);
            StringAssert.Contains(string.Format("using {0};", boProjectName), contents);
        }
    }
}
